<!--提交月报页面-->
<!DOCTYPE html>
<html>
	<head>
		<meta charset="utf-8">
		<meta name="viewport" content="width=device-width,initial-scale=1,minimum-scale=1,maximum-scale=1,user-scalable=no" />
		<title>学生端实习报告列表</title>
		<script src="../../script/mui.min.js"></script>
		<link href="../../css/mui.min.css" rel="stylesheet"/>
		<link rel="stylesheet" type="text/css" href="../../css/base.css"/>
		<link rel="stylesheet" type="text/css" href="../../css/CFNetPP_Base.css">
		<script type="text/javascript" src="../../script/echarts.min.js"></script>
		<script type="text/javascript" charset="utf-8">
			mui.init();
		</script>
		<style>
			.listDiv .base_dark_grey {
				color: #000000
			}
			.listDiv .base_grey {
				color: #333333
			}
			.listDiv .base_light_gray {
				color: #666666;
			}
			.listDiv .mui-table-view-cell:after {
				background-color: #EDEDED;
			}
			.left_div{
			
			float: left;
			}
			.right_div{
			
			float: right;
			}
			
			.cropname_div{
			padding: 12px 2px;
			
			}
		</style>
	</head>
	<body>
		<ul id="list_id" class="mui-table-view checkapply listDiv" >
		<!--<li class="mui-table-view-cell mui-media list_month">
			<div class="mui-media-body">
			<div class="left_div">
			
			<p class="font16 base_dark_grey">
			2016-12-12
			</p>
			<p class="base_grey">石家庄安得物流</p>
			</div>
			
			<div class="right_div cropname_div" >
			
			<p class="base_grey mui-pull-right ">叉车操作员</p>
			</div>

			</li>-->
			
			
			
	
		</ul>
		<div class="noSign"  id="noData" hidden="hidden">
			<img src="../../image/icon_img.png" width="60%" >
			<p class="font16 top_15 base_dark_grey" >
				暂无数据
			</p>
		</div>
		<div class="loadFailure" hidden="hidden" id="noNet">
			<img src="../../image/icon_img01.png" width="60%">
			<p class="" >
				数据加载失败
			</p>
			<p>
				请检查您的网络
			</p>
			<button type="button" class="mui-btn mui-btn-outlined" onclick="RefreshData()">
				重新加载
			</button>
		</div>
	</body>
	<script type="text/javascript" src="../../script/api.js"></script>
	<script src="../../script/common.js"></script>
	<script src="../../script/jquery.min.js" type="text/javascript"></script>
	<script type="text/javascript" src="../../script/MD5.js"></script>
	<script type="text/javascript" src="../../script/requestTool.js"></script>
	<script type="text/javascript">
		var refreshCount = 0;
		//更新数据条数
		var dataArr = new Array();
		var weightratio = new Array();
		var page = 1;
		var row = 10;
		apiready = function() {
			showProgress();
			loadNewData();
		SendBehaviorTrajectoriesNotifi1('1', '学生端实习报告列表', '096',  api.pageParam.sourceurl, api.pageParam.sourcetitle, window.location.pathname, document.title);
			setRefreshHeader();
			setPullUpRefresh();
			ReceiveNotifi();
		}
		function ReceiveNotifi() {
			api.addEventListener({
				name : 'RefreshReportNotifi'
			}, function(ret, err) {
				//			alert(JSON.stringify(ret.value));
				loadNewData();
				//				alert('已刷新页面');
			});
		}

		function RefreshData() {
			$('#noNet').hide();
			showProgress();
			loadNewData();
		}

		//从网路获取数据
		function loadData() {
			var param = {
				uid : $api.getStorage('cfnetppuid'),
				jid : $api.getStorage('cfnetppjid'),
				page : page,
				rows : row,
			};
		
			cfnetppPOST(urlJybglist, param, false, function(data, status) {
//								alert(JSON.stringify(data));
//																alert(JSON.stringify(data));
				api.refreshHeaderLoadDone();
				hideProgress();
				if (status == 'success') {
					$('#noNet').hide();
					if (data.status == 1) {
						$('#noData').hide();
						var list = data.json;
						if (list != null && list.constructor == Array && list.length > 0) {
							$('#noData').hide();
							refreshCount = list.length;
							var listArr = new Array();
							var htmlString = new String();
							if (page == 1) {
								for (var i = 0; i < list.length; i++) {
									var monthData = list[i];
									var data = {
										repid : monthData.id,
										//实习报告提交时间
										submittime : monthData.instime,
										//企业名称
										planname : monthData.planname,
//										work_name : monthData.work_name,
										reviewstatus : monthData.reviewstatus,
										sxtypes : monthData.sxtypes
									};
									
									listArr.push(data);
									htmlString += htmlStringWithName(data, i);
								}
								dataArr = listArr;
								$('#list_id').html(htmlString);
							} else {
								var oldCount = dataArr.length;
								for (var i = 0; i < list.length; i++) {
									var index = oldCount + i;
									var monthData = list[i];
									var data = {
										repid : monthData.id,
										//实习报告提交时间
										submittime : monthData.instime,
										//企业名称
										planname : monthData.planname,
//										work_name : monthData.work_name,
										reviewstatus : monthData.reviewstatus,
										sxtypes : monthData.sxtypes
									};
									listArr.push(data);
									htmlString += htmlStringWithName(data, index);
								}
								dataArr = dataArr.concat(listArr);
								$('#list_id').append(htmlString);
							}
							setupTapCellClick();
						} else {
							if (page == 1) {
								$('#noData').show();
								//
							} else {
								api.toast({
									msg : '暂无数据',
									duration : 2000,
									location : 'bottom'
								});
							}
							$('#list_id').html('');
						}
					} else {
						if (page == 1) {
							$('#noData').show();
						}
					}
				} else {
					$('#noNet').show();
				}
			});
		}

		//		function loadNewData() {
		//			page = 1;
		//			loadData();
		//		}
		//
		//		function loadMoreData() {
		//			page++;
		//			loadData();
		//		}
		function htmlStringWithName(data, index) {
			var spanClassString = '<span class="shenhebtn mui-pull-right">';
			var spanstate = data.reviewstatus;
			var time = parseInt(data.submittime);
			var submittime = getLocalTime(time);
			var planname = notTen(data.planname);
//			var work_name = notTen(data.work_name);
//			var spanComment = corp_name + work_name;
			
//			//		    alert(time);
//			if (spanstate == '1') {
//				spanClassString = '<span class="cstudentbtn1 mui-pull-right">已审核';
//			} else {
//				spanClassString = '<span class="cstudentbtn0 mui-pull-right">未审核';
//			}
			//
			return  '<li dataid="' + index + '"  class="mui-table-view-cell mui-media list_month">'+
						'<div class="mui-media-body">'+
						'<div class="left_div">'+
						'<p class="font16 base_dark_grey">' + 
						submittime
						+'</p>'
						+'<p class="base_grey">' + planname + '</p>'
						+'</div>'
//						+'<div class="right_div cropname_div" >'
//						+'<p class="base_grey mui-pull-right ">' + work_name + '</p>'
//						+'</div>'
			       +'</li>'
			
			
			
			
			
		
		}

		function setupTapCellClick() {
			$('.list_month').unbind('click');
			$('.list_month').click(function() {
				var dataid = $(this).attr('dataid');
				var data = dataArr[parseInt(dataid)];
				var repid = parseInt(data.repid);
				var sxtypes = data.sxtypes;
				api.openWin({useWKWebView:true,
					name : 'Student_completionReporFrametDetail',
					url : 'Student_completionReporFrametDetail.html',
					pageParam : {
						repid : repid,
						sxtypes : sxtypes,
						sourceurl : window.location.pathname,
						sourcetitle : document.title
					},
					allowEdit : true
				});
			});
		}

	
	</script>
</html>